<?php

require_once __DIR__ . '/../sdk/autoload.php';
require_once __DIR__ . '/handle.php';
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$bank = $_REQUEST;
$params = require_once __DIR__ . '/config/params.php';
$cert = require_once __DIR__ . '/config/cert.php';
header("Content-type: text/html; charset=utf-8");
$handle = new handle($cert);
if (isset($_REQUEST['demo'])) {
	$route = $_REQUEST['demo'];
	switch ($route) {
		case 'AgentPay';
			$res = $handle->execute($params['AgentPay']);
			break;
		case 'Collection';
			$res = $handle->execute($params['Collection']);
			break;
		case 'IdCardVerify';
			$res = $handle->execute($params['IdCardVerify']);
			break;
		case 'QueryBalance';
			$res = $handle->execute($params['QueryBalance']);
			break;
		case 'QueryFee';
			$res = $handle->execute($params['QueryFee']);
			break;
		case 'QueryOrder';
			$res = $handle->execute($params['QueryOrder']);
			break;
		case 'RealNameVerify';
			$res = $handle->execute($params['RealNameVerify']);
			break;
		case 'getClearFileContent';
			$res = $handle->execute($params['getClearFileContent']);
			break;
		default;
			$res = '没有demo:' . $route;
			break;
	}
	echo $res;
} else {
	echo '缺少参数demo';
}